//
//  EventStatisticsAPIRequest.m
//  ConvenientlyTake
//
//  Created by 张奇 on 2022/12/23.
//

#import "EventStatisticsAPIRequest.h"

@implementation EventStatisticsAPIRequest

/// 获取所有有权限访问的部门
/// @param success success
/// @param fail fail
+(NSURLSessionDataTask *)GETAllDepartmentWithsuccess:(LZTResponseSuccess)success fail:(LZTResponseFailure)fail {
    
    return [self GETWithURLString:@"api/public/department/findAllEnabled" parameters:nil success:success failure:fail];
}

/// 获取事件统计
/// @param startDate 查询开始日期
/// @param endDate 查询结束日期
/// @param county 区县
/// @param disposalDeptId 部门
/// @param success success
/// @param fail fail
+(NSURLSessionDataTask *)GETGetEventStatisticsWithStartDate:(NSString *)startDate
                                                    endDate:(NSString *)endDate
                                                     county:(NSString *)county
                                             disposalDeptId:(NSString *)disposalDeptId
                                                    success:(LZTResponseSuccess)success fail:(LZTResponseFailure)fail {
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    [parameters setValue:R(startDate) forKey:@"startDate"];
    [parameters setValue:R(endDate) forKey:@"endDate"];
    if (!EmptyCheck(county)) {
        [parameters setValue:R(county) forKey:@"county"];
    }
    if (!EmptyCheck(disposalDeptId)) {    
        [parameters setValue:R(disposalDeptId) forKey:@"disposalDeptId"];
    }
    
    return [self GETWithURLString:@"api/m/event-statistics/getEventStatistics" parameters:parameters success:success failure:fail];
}

@end
